package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "丘丘人")
@Order(1006)
@Component
public class QiuQiuRen extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int dmg;
        String desc;

        if(first.getUserBO().getName().equals("丘丘人弓箭手")){
            desc = "瞄准射击";
        }else {
            desc = RandomUtil.choice(Lists.newArrayList("挥拳","投掷"));
        }
        int orgAtk = first.getBattleInfo().getAtk();
        int def = second.getBattleInfo().getDef();
        int atk = (int) (orgAtk * 1.3);
        dmg = battleHelper.calAtk(atk, def);
        battleHelper.autoAction(this, first, second, content, dmg, desc);
    }

    @Override
    public void limit(UserBO user) {
        throw new HandlerException("无法学习妖兽的攻击手段");
    }

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return "提瓦特荒野中游荡的原始住民。\n" +
                "与人类轮廓相似，却失去了智能与灵性。据记载，在大地上出没超过千年，却没有历史与文明。\n" +
                "自五百年前漆黑的灾祸以来，便广袤地分布在大地各处。虽然力量弱小，缺乏组织，但有时也能给人们带来不小的麻烦\n\n" +
                "分为丘丘人战士和丘丘人弓箭手，会使用普通的物理攻击 \n" +
                "丘丘人战士 ：挥拳,投掷\n" +
                "丘丘人弓箭手 ：瞄准射击\n\n" +
                "出没地点：\t风起地，千风神殿\n丘丘人战士会额外出现在苍风高地，丘丘人弓箭手会额外出现在风龙废墟" ;
    }


}
